<?php if (!defined('THINK_PATH')) exit();?><!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<link rel="stylesheet" type="text/css" href="/dcms/Public/common.css" />
	<script type="text/javascript" src="/dcms/Public/Admin/resources/scripts/jquery-1.7.2.min.js"></script>
	<link rel="stylesheet" type="text/css" href="/dcms/Public/Boot/bootstrap.min.css" />
	<script type="text/javascript" src="/dcms/Public/Boot/bootstrap.min.js"></script>
	<link rel="stylesheet" type="text/css" href="/dcms/Public/Button/css/font-awesome.min.css" />
	
</head>
<body>
	<div>
		<p>
 		 <button type="button" class="btn btn-primary ">内容列表</button>
 		 <a href="<?php echo U('Content/add',array('cid'=>$_GET['cid']));?>" class="btn btn-info" >添加内容</a>
		</p>
	</div>
	<!-- 模型缓存 -->
	<script type="text/javascript">
	function cache(obj){
		$.get("<?php echo U('Category/updateCache');?>",function(data){
			if(data==1){
				$(".Upcache").fadeIn('2000').fadeOut('1000');
			}else{
				$(".Upcache").html("缓存失败");
				$(".Upcache").fadeIn('1000').fadeOut('1000');
			}
		})
	}
	</script>

	<div class="table-responsive">
  		<table class="table table-striped">
    		<tr>
				<td class="w30">contid</td>
				<td class="w30">cid</td>
				<td class="w500">标题</td>
				<td class="w100">图片</td>
				<td class="w100">作者</td>
				<td class="w200">修改时间</td>
				<td >操作</td>

			</tr>
			<?php if(is_array($content)): $i = 0; $__LIST__ = $content;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$c): $mod = ($i % 2 );++$i;?><tr>
				<td><?php echo ($c["contid"]); ?></td>
				<td><?php echo ($c["cid"]); ?></td>
				<td><?php echo ($c["title"]); ?>&nbsp[<span style="font-size:12px;color:red;padding:5px;font-weight: 700;"><?php echo ($c["flag"]); ?></span>]</td>
				<td>
					<?php if($c["thumb"] == ''): ?>无图
					<?php else: ?>
						<img style="width:30px;height:30px;" src="/dcms /<?php echo ($c["thumb"]); ?>"><?php endif; ?>
				</td>
				<td >
					admin
				</td>
				<td>
					<?php echo (date("y-m-d h:i:s",$c["addtime"])); ?>
				</td>
				<td class="w300">
					<!-- <?php echo U('category/addcate',array('cid'=>$c['cid']));?> -->
					
					<a href="<?php echo U('edit',array('contid'=>$c['contid'],'cid'=>$c['cid']));?>"   class="btn btn-default  icon-edit" >编辑</a>
					<a href="javascript:;"  attr="<?php echo ($c["cid"]); ?>" contid="<?php echo ($c["contid"]); ?>" onclick="return del(this)" class="btn btn-default  icon-cut">删除</a>
				</td>
			</tr><?php endforeach; endif; else: echo "" ;endif; ?>
  		</table>
	</div>

<!-- 删除 -->
<script type="text/javascript">
	function del(obj){
		if(confirm('确认要删除吗？')){
			var cid = $(obj).attr('attr');
			var contid=$(obj).attr('contid');
			$.post("<?php echo U('del');?>",{contid:contid,cid:cid},function(data){
				if(data==1){
					$(obj).parent('td').parent('tr').remove();
				}
			})
		}
		return false;
	}
</script>




</body>
</html>